//
//  RegisterView.m
//  豆瓣
//
//  Created by liuxin on 15/10/26.
//  Copyright (c) 2015年 liuxin. All rights reserved.
//

#import "RegisterView.h"

@implementation RegisterView
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if(self){
        [self createSubView];
    }
    return self;
}
-(void)createSubView{
    NSArray *array = [NSArray arrayWithObjects:@"用户名:", @" 密  码:",@"确认密码:",@" E_mail:",@"联系方式:",nil];
    NSArray *array1= [NSArray arrayWithObjects:@"请输入用户名",@"请输入密码",@"请再次输入密码",@"请输入邮箱",@"请输入联系方式", nil];
    
    for(int i = 0; i < array.count; i++){
        UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(50, 100+i*50, 80, 30)];
        label.tag = 1000+i;
        label.text =[array objectAtIndex:i];
        [self addSubview:label];
        [label release];
    
        UITextField *textField = [[UITextField alloc]initWithFrame: CGRectMake(140, 100+i*50, 200, 30)];
        textField.borderStyle = UITextBorderStyleRoundedRect;
        textField.tag = 1100+i;
        if(textField.tag>=1101&&textField.tag<=1102){
            textField.secureTextEntry = YES;
        }
        textField.clearButtonMode = UITextFieldViewModeAlways;
        textField.placeholder = [array1 objectAtIndex:i];
        [self addSubview:textField];
        [textField release];
    }
}

@end
